home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / util / comm / arapp960.sit / PP9600SA fix next >
Text File  |  1992-10-27  |  3KB  |  208 lines

  1. ! "Practical Modem 9600SA - 4/22/92"
  2. !
  3. @ORIGINATE
  4. @ANSWER
  5. !
  6. @LABEL 1
  7. serreset 9600, 0, 8, 1
  8. !
  9. ! first recall the factory configuration
  10. !
  11. matchclr
  12. settries 0
  13. matchstr 1 3 "OK\13\10"
  14. @LABEL 2
  15. pause 1
  16. write "AT&F\13"
  17. matchread 30
  18. inctries
  19. iftries 2 59
  20. jump 2
  21. !
  22. ! Next, Set up the configuration: Echo off, disable flow control
  23. !
  24. @LABEL 3
  25. matchstr 1 4 "OK\13\10"
  26. pause 1
  27. write "ATE0&K0\13"
  28. matchread 30
  29. jump 59
  30. !
  31. ! Next, configure to reset when DTR is dropped, turn off error control
  32. !
  33. @LABEL 4
  34. matchstr 1 5 "OK\13\10"
  35. matchstr 2 5 "ERROR\13\10"
  36. pause 1
  37. write "AT&D3&Q0\13"
  38. matchread 30
  39. !
  40. ! If speaker on flag is true, jump to label 8.  Else turn off the speaker
  41. !
  42. @LABEL 5
  43. matchclr
  44. ifstr 2 8 "1"
  45. matchstr 1 8 "OK\13\10"
  46. pause 1
  47. write "ATM0\13"
  48. matchread 30
  49. jump 59
  50. !
  51. ! The modem is ready.  So enable answering, or originate a call
  52. !
  53. @LABEL 8
  54. ifANSWER 30
  55. note "Dialing ^1" 3
  56. pause 1
  57. write "ATS0=0DT^1\13"
  58. !
  59. @LABEL 9
  60. matchstr  1 11 "CONNECT 1200\13\10"
  61. matchstr  2 12 "CONNECT 2400\13\10"
  62. matchstr  3 13 "CONNECT 4800\13\10"
  63. matchstr  4 14 "CONNECT 9600\13\10"
  64. matchstr  5 50 "NO CARRIER\13\10"
  65. matchstr  6 50 "ERROR\13\10"
  66. matchstr  7 52 "NO DIALTONE\13\10"
  67. matchstr  8 53 "BUSY\13\10"
  68. matchstr  9 54 "NO ANSWER\13\10"
  69. matchread 700
  70. jump 59
  71. !
  72. @LABEL 11
  73. note "Communicating at 1200 bps." 2
  74. serreset 1200, 0, 8, 1
  75. jump 16
  76. !
  77. @LABEL 12
  78. note "Communicating at 2400 bps." 2
  79. serreset 2400, 0, 8, 1
  80. jump 16
  81. !
  82. @LABEL 13
  83. note "Communicating at 4800 bps." 2
  84. serreset 4800, 0, 8, 1
  85. jump 16
  86. !
  87. @LABEL 14
  88. note "Communicating at 9600 bps." 2
  89. serreset 9600, 0, 8, 1
  90. jump 16
  91. !
  92. @LABEL 16
  93. ifANSWER 17
  94. pause 30
  95. @LABEL 17
  96. exit 0
  97. !
  98. ! @ANSWER
  99. ! Set up the modem to answer
  100. @LABEL 30
  101. pause 1
  102. write "ATS0=1\13"
  103. matchstr 1 31 "OK\13\10"
  104. matchread 30
  105. jump 59
  106. !
  107. @LABEL 31
  108. matchstr 1  32 "RING\13\10"
  109. matchstr 2  11 "CONNECT 1200\13\10"
  110. matchstr 3  12 "CONNECT 2400\13\10"
  111. matchstr 4  13 "CONNECT 4800\13\10"
  112. matchstr 5  14 "CONNECT 9600\13\10"
  113. matchstr 6  50 "NO CARRIER\13\10"
  114. matchstr 7  50 "ERROR\13\10"
  115. matchstr 8  52 "NO DIALTONE\13\10"
  116. matchstr 9  53 "BUSY\13\10"
  117. matchstr 10 54 "NO ANSWER\13\10"
  118. matchread 700
  119. jump 31
  120. !
  121. @LABEL 32
  122. userhook 1
  123. note "Answering phone╔" 2
  124. jump 31
  125. !
  126. ! 50: error messages
  127. !
  128. @LABEL 50
  129. exit -6021
  130. !
  131. @LABEL 52
  132. exit -6020
  133. !
  134. @LABEL 53
  135. exit -6022
  136. !
  137. @LABEL 54
  138. exit -6023
  139. !
  140. @LABEL 59
  141. exit -6019
  142. !
  143. ! Hang up the modem
  144. !
  145. @HANGUP
  146. @LABEL 60
  147. settries 0
  148. @LABEL 61
  149. pause 1
  150. write "ATH0\13"
  151. matchclr
  152. matchstr 1 64 "OK\13\10"
  153. matchstr 2 63 "NO CARRIER\13\10"
  154. matchstr 3 64 "ERROR\13\10"
  155. matchread 15
  156. inctries
  157. iftries 3 64
  158. ! no response, try escape sequence
  159. pause 1
  160. write "+++"
  161. matchclr
  162. matchstr 1 62 "OK\13\10"
  163. matchread 18
  164. ! No response from modem, toggle DTR
  165. !
  166. DTRClear
  167. pause 10
  168. DTRSet
  169. jump 61
  170. !
  171. @LABEL 62
  172. DTRClear
  173. pause 10
  174. DTRSet
  175. pause 5
  176. matchclr
  177. matchstr 1 64 "OK\13\10"
  178. matchstr 2 64 "NO CARRIER\13\10"
  179. pause 1
  180. write "ATH0\13"
  181. matchread 150
  182. jump 61
  183. !
  184. @LABEL 63
  185. pause 45
  186. flush
  187. !
  188. ! Recall the factory settings
  189. !
  190. @LABEL 64
  191. matchclr
  192. matchstr 1 65 "OK\13\10"
  193. pause 1
  194. write "AT&F\13"
  195. matchread 30
  196. !
  197. @LABEL 65
  198. matchstr 1 66 "OK\13\10"
  199. pause 1
  200. write "ATS0=0\13"
  201. matchread 30
  202. !
  203. @LABEL 66
  204. exit 0
  205.  
  206.  
  207.  
  208.